package main

import "fmt"

// 逻辑运算符
// 逻辑运算符 || 代表“逻辑或”，而逻辑运算符 && 则代表“逻辑与”
// 等同于java中，会短路

func main() {
	// 判断 2100 年是否为闰年
	fmt.Println("The year is 2100, should you leap?")

	var year = 2100
	var leap = year%400 == 0 || (year%4 == 0 && year%100 != 0)

	if leap {
		fmt.Println("Look before you leap!")
	} else {
		fmt.Println("Keep your feet on the ground.")
	}

	// The year is 2100, should you leap?
	// Keep your feet on the ground.
}
